<?php 
$form_name='login_form_';
?>

<form method="post" name="<?php echo $form_name;?>" id="<?php echo $form_name;?>" action="">
<input type="hidden" name="login_posted" value="1"/>
	<table class="form_table">
	<tbody>
		<tr>
			<td><?php echo Lang::get('EMAIL');?></td>
			<td>
				<input type="text" name="email" id="email" value="<?php echo Form::value( $form_name, 'email');?>"/>
				<div class="error"><?php echo Form::error( $form_name, 'email');?></div>
			</td>
		</tr>
		<tr>
			<td><?php echo Lang::get('PASSWORD'); ?></td>
			<td>
				<input type="password" name="password" id="password" />
				<div class="error"><?php echo Form::error( $form_name, 'password');?></div>
			</td>
		</tr>
		<tr>
			<td><input type="submit" name="submit" value="<?php echo Lang::get('ENTER'); ?>"/></td>
			<td></td>
		</tr>
	</tbody>	
	</table>
</form>

<script type="text/javascript">
var id = 'login_form_';
	elem = document.getElementById( id );
if(!elem || !elem.innerHTML) {
	debug( id+' isn\'t a HTMLElement or not a single', id );
}else{
	elem.onsubmit = function( event ){
		var form = this;
		ajaxRequest({
			url: '/ajax/'+form.name+'.php',
			data: getRequestBody( form ),
			dataType: "json",
			type: "post"
		});
		
		return false;
	}	
}	
</script>